/* 
 * File:   openfileexception.h
 * Author: Luis Aguirre
 * Description: Exception that will be thrown when a file can't be open.
 *
 * Created on jule 24, 2013, 10:38 AM
 */

#ifndef OPENFILEEXCEPTION_H
#define	OPENFILEEXCEPTION_H

#include "fileexception.h"

class OpenFileException : public FileException
{
public:

    OpenFileException(const char* file)
    {
        message_ = "File can't be open: ";
        message_.append(file);
        message_.append(".");
    }
    
    virtual ~OpenFileException() throw(){}

    /**
     * Describe the general cause of the current error. 
     * 
     * @return String with the error.
     */
    virtual const char* what() const throw ()
    {
        return message_.c_str();
    }
private:
    /**
     * Message containing the error.
     */
    std::string message_;
};

#endif	/* OPENFILEEXCEPTION_H */

